package com.dense.kuiniu.bookborrow.business.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * @author Administrator
 * @date 2020/8/21
 */
public class Reader implements Parcelable {

    private Info vuserInfo;
    private ArrayList<BorrowBook> bookList;

    public Info getVuserInfo() {
        return vuserInfo;
    }

    public void setVuserInfo(Info vuserInfo) {
        this.vuserInfo = vuserInfo;
    }

    public ArrayList<BorrowBook> getBookList() {
        return bookList;
    }

    public void setBookList(ArrayList<BorrowBook> bookList) {
        this.bookList = bookList;
    }

    public static class Info implements Parcelable {

        /**
         * borrowBookCount : 20
         * state : 正常
         * userName : 秦婷
         * borrowPeriodicalCount : 0
         * account : 01000000227792
         */
        private int borrowBookCount;
        private String state;
        private String userName;
        private int borrowPeriodicalCount;
        private String account;

        public void setBorrowBookCount(int borrowBookCount) {
            this.borrowBookCount = borrowBookCount;
        }

        public void setState(String state) {
            this.state = state;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        public void setBorrowPeriodicalCount(int borrowPeriodicalCount) {
            this.borrowPeriodicalCount = borrowPeriodicalCount;
        }

        public void setAccount(String account) {
            this.account = account;
        }

        public int getBorrowBookCount() {
            return borrowBookCount;
        }

        public String getState() {
            return state;
        }

        public String getUserName() {
            return userName;
        }

        public int getBorrowPeriodicalCount() {
            return borrowPeriodicalCount;
        }

        public String getAccount() {
            return account;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.borrowBookCount);
            dest.writeString(this.state);
            dest.writeString(this.userName);
            dest.writeInt(this.borrowPeriodicalCount);
            dest.writeString(this.account);
        }

        public Info() {
        }

        protected Info(Parcel in) {
            this.borrowBookCount = in.readInt();
            this.state = in.readString();
            this.userName = in.readString();
            this.borrowPeriodicalCount = in.readInt();
            this.account = in.readString();
        }

        public static final Parcelable.Creator<Info> CREATOR = new Parcelable.Creator<Info>() {
            @Override
            public Info createFromParcel(Parcel source) {
                return new Info(source);
            }

            @Override
            public Info[] newArray(int size) {
                return new Info[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.vuserInfo, flags);
        dest.writeTypedList(this.bookList);
    }

    public Reader() {
    }

    protected Reader(Parcel in) {
        this.vuserInfo = in.readParcelable(Info.class.getClassLoader());
        this.bookList = in.createTypedArrayList(BorrowBook.CREATOR);
    }

    public static final Parcelable.Creator<Reader> CREATOR = new Parcelable.Creator<Reader>() {
        @Override
        public Reader createFromParcel(Parcel source) {
            return new Reader(source);
        }

        @Override
        public Reader[] newArray(int size) {
            return new Reader[size];
        }
    };
}